﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Automation;
using DB.SchemaSync.Library.Models;
using GalaSoft.MvvmLight;
using Microsoft.Xaml.Behaviors.Media;

namespace MSSQL.DBSync.UI.Components.MakeComparsion.vos
{

    /// <summary>
    /// 比较结果对象
    /// </summary>
    public class CompareResVO : ObservableObject
    {
        public CompareResVO()
        {
        }

        private string mName;
        /// <summary>
        /// 名称
        /// </summary>
        public string Name
        {
            get => mName;
            set => Set(ref mName, value);
        }


        private Type mType;
        /// <summary>
        /// 类型
        /// </summary>
        public Type Type
        {
            get => mType;
            set => Set(ref mType, value);
        }

        private string mTypeName;
        /// <summary>
        ///　类型名称 Column ....
        /// </summary>
        public string TypeName
        {
            get => mTypeName;
            set => Set(ref mTypeName, value);
        }


        private string mDesc;
        /// <summary>
        /// 描述
        /// </summary>
        public string Desc
        {
            get => mDesc;
            set => Set(ref mDesc, value);
        }


        /// <summary>
        /// 变更类型 Add Modify Delete
        /// </summary>
        private string mChangeType;

        public string ChangeType
        {
            get => mChangeType;
            set
            {
                Set(ref mChangeType, value);
                if ( TypeName.ToLower() == "column" && mChangeType.ToLower() == "delete")
                {
                    DispColor = "red";
                }
            }
        }


        /// <summary>
        /// 关联业务成对象
        /// </summary>
        public DbObject RefObject { get; set; }


        /// <summary>
        /// 是否被选中
        /// </summary>
        private bool mIsSelect;

        public bool IsSelect
        {
            get => mIsSelect;
            set
            {
                Set(ref mIsSelect, value);
                if (RefObject != null)
                {
                    RefObject.IsSelect = value;
                }
            }
        }


        /// <summary>
        /// 是否被选中
        /// </summary>
        private string mDispColor = "black";

        public string DispColor
        {
            get => mDispColor;
            set => Set(ref mDispColor, value);

        }
    }
}
